/**
 * 
 */
package com.base.myproject.client.ui.celleditor;

import com.extjs.gxt.ui.client.binding.FieldBinding;

/**
 * 在form里绑定BaseComboBoxForm，
 * 因为combox保存的是modeldata而不是一个string，
 * 所以要做string和modeldata之间的转换
 * @author zgw
 *2009-9-3 下午08:56:30
 * javazgw@gmail.com
 */
public class BaseComBoxFromBinding  extends FieldBinding{

	 protected BaseComboBoxForm simpleComboBox;
	 public BaseComBoxFromBinding(BaseComboBoxForm field, String property) {
		    super(field, property);
		    this.simpleComboBox = field;
		  }
	 
	 
	  @Override
	  protected Object onConvertFieldValue(Object value) {
	    return simpleComboBox.getSimpleValue();
	  }

	  @SuppressWarnings("unchecked")
	@Override
	  protected Object onConvertModelValue(Object value) {
	    return simpleComboBox.findModel(value);
	  }
}
